home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
TEMP
/
GNU
/
bison
/
HowPrecede
< prev
next >
Wrap
Text File
|
1995-06-28
|
1KB
|
25 lines
How Precedence
Previous: <Precedence Examples=>Precedencg> * Next: <Contextual Precedence=>Contextual> * Up: <Precedence=>Precedencf>
#Wrap on
{fH4}How Precedence Works{f}
The first effect of the precedence declarations is to assign precedence
levels to the terminal symbols declared. The second effect is to assign
precedence levels to certain rules: each rule gets its precedence from the
last terminal symbol mentioned in the components. (You can also specify
explicitly the precedence of a rule. \*Note <Contextual Precedence=>Contextual>: Context-Dependent Precedence.)
Finally, the resolution of conflicts works by comparing the
precedence of the rule being considered with that of the
look-ahead token. If the token's precedence is higher, the
choice is to shift. If the rule's precedence is higher, the
choice is to reduce. If they have equal precedence, the choice
is made based on the associativity of that precedence level. The
verbose output file made by {fEmphasis}-v{f} (\*Note <Invocation=>Invocation>: Invoking Bison) says
how each conflict was resolved.
Not all rules and not all tokens have precedence. If either the rule or
the look-ahead token has no precedence, then the default is to shift.